﻿using Loki.Data;
using Loki.Data.SqlServer;
using Loki.IoC;
using Loki.IoC.Registration;

namespace Luna.Data.SqlServer
{
    public class DatabaseInstaller : LokiContextInstaller
    {
        private static DatabaseInstaller localSql = new DatabaseInstaller();

        public static DatabaseInstaller LocalSql
        {
            get
            {
                return localSql;
            }
        }

        public override void Install(IObjectContext context)
        {
            context.Register(Element.For<IRepositoryManager>().ImplementedBy<LocalSqlRepositoryManager>());
            context.Register(Element.For<IDatabaseAdapter>().ImplementedBy<SqlDatabaseAdapter>());
        }
    }
}